<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            height: 3000px;
        }

        .d1 {
            height: 200px;
            width: 200px;
            background-color: red;
        }
    </style>
</head>

<body>
    <div class="d1"></div>
    <input type="text">
    <script>
        var div = document.getElementsByClassName('d1')[0]
        div.addEventListener('click', function () {
            console.log('单击')
        })

        div.addEventListener('dbclick', function () {
            console.log('双击')
        })

        div.addEventListener('mousedown ', function () {
            console.log('按下')
        })

        div.addEventListener('mouseup', function () {
            console.log('抬起')
        })

        div.addEventListener('mouusemov', function () {
            console.log('移动')
        })



        document.addEventListener('keypress', function () {
            console.log('某一个键被敲击了')
        })

        document.addEventListener('keydown', function () {
            console.log('某一个键被按下了，还未抬起')
        })

        document.addEventListener('keyup', function () {
            console.log('某一个键被抬起了')
        })


        window.addEventListener('resize', function () {
            console.log('窗口尺寸被改变了')
        })

        window.addEventListener('scroll', function () {
            console.log('窗口被滚动了')
        })



        inp.addEventListener('input', function () {
            comsole.log('input输入')
        })

        inp.addEventListener('focus', function () {
            comsole.log('input聚焦')
        })

        inp.addEventListener('blur', function () {
            comsole.log('input失焦')
        })

        inp.addEventListener('change', function () {
            comsole.log('input输入框change')
        })
    </script>
</body>

</html>